/* mixin */
import ConnectorModuleCardSettingMixin from '@src/modules/connector/mixin/card-setting'
/* model */
import { ConnectorBizTypeEnum, ConnectorFromBizTypeEnum, ConnectorModuleComponentNameEnum } from '@src/modules/connector/model'
/* vue */
import { ComponentInstance, ComponentRenderProxy, defineComponent, ref } from 'vue'
import { CommonComponentInstance } from '@model/VC'
import { t } from '@src/locales'

export type ConnectorModuleCardSettingCustomerMixinProps = {
  visible: boolean;
}

export interface ConnectorModuleCardSettingCustomerMixinSetupState {
  
}

export enum ConnectorModuleCardSettingCustomerMixinEmitEventNameEnum {
  Input = 'input'
}

export type ConnectorModuleCardSettingCustomerMixinInstance = ComponentInstance & ConnectorModuleCardSettingCustomerMixinSetupState
export type ConnectorModuleCardSettingCustomerMixinVM = ComponentRenderProxy<ConnectorModuleCardSettingCustomerMixinProps> & CommonComponentInstance & ConnectorModuleCardSettingCustomerMixinInstance

export default defineComponent({
  name: ConnectorModuleComponentNameEnum.ConnectorModuleCardSettingCustomerMixin,
  mixins: [ConnectorModuleCardSettingMixin],
  emits: [
  ],
  data() {
    return {
      toBizType: ''
    }
  },
  computed: {
    bizTypeId(): ConnectorFromBizTypeEnum {
      return this.isCustomer ? ConnectorFromBizTypeEnum.Customer : ConnectorFromBizTypeEnum.Product
    },
    fromBizTypeName(): string {
      return this.isCustomer ? t('common.connector.customerForm') :  t('common.connector.productForm')
    },
    fromBizType(): ConnectorBizTypeEnum {
      return this.isCustomer ? ConnectorBizTypeEnum.Customer : ConnectorBizTypeEnum.Product
    },
    /* 混入的页面需要重写此计算属性 */
    isCustomer(): boolean {
      return true
    }
  }
})
